1. Field of The Invention
The present invention relates to a method and apparatus for processing a gray scale image, and especially to a method and apparatus capable of adequately processing such an image that has a cluttered background and/or the unevenness in its brightness.
2. Description of The Related Art
Generally, in the case where characters or a figure are to be recognized by an image processing system, there is often used the technique, in which image data of a gray scale picture taken by, for example, an industrial television (ITV) camera is binarized with a certain threshold of a gray level (i.e., brightness) and the thus binarized image data is processed for recognition. Such a threshold can be easily determined in advance, when high contrast images, such as black characters on a white background, are subjected to processing for the recognition of characters or a figure. Also, it is not so difficult, if there is no unevenness or fluctuation in the illumination on a subject which has characters or a figure to be recognized thereon.
However, the aforesaid threshold can not be easily determined in more general applications as follows; the recognition of characters or figure on patterned packing boxes or outdoor billboards, the extraction of specific characters or a pattern from complicated patterns of printed circuit boards, and the recognition of the vehicle license numbers of running vehicles. In these applications, characters or figure to be recognized or extracted lie in complicated backgrounds, and the brightness of the illumination can changed very greatly. Therefore, it is very difficult to determinate a single appropriate threshold for extracting a subject to be recognized, while distinguishing it from a complicated background or eliminating the influence of the unevenness or fluctuation of illumination.
To overcome the above mentioned problems, for example, a method as disclosed in pp. 35 to 46 of a report PRL85-73 of Technical Study Group on Pattern Recognition and Learning, Institute of Electrical Communication Engineers of Japan (February, 1986) has been proposed. According to this, as shown in FIG. 1a, one frame of a gray scale picture 1, which is taken by an ITV camera, for example, and includes a FIG. 3 to be recognized, is divided into plural subblocks 5. As shown in FIG. 1b, appropriate thresholds .theta..sub.ij are determined for the respective subblocks 5. The determination of the thresholds in this case is grasped as a two-class problem, according to which image data within the subblock 5 classified into black and white classes, and the threshold .theta..sub.ij in each subblock 5 is selected to be a value which makes the dispersion between the classes maximal.
Further, in order to maintain the continuity between the subblocks 5, as shown in FIG. 1c, an interpolation is conducted between the thresholds .theta..sub.ij of the adjacent subblocks 5 pixel by pixel and, as a result, a threshold .theta.(x, y) for every pixel can be obtained. The input image data of the gray scale picture are binarized on the basis of the corresponding threshold .theta.(x, y) thus obtained pixel by pixel.
In the prior art mentioned above, in order to determine the threshold .theta..sub.ij within a certain subblock 5, two-dimensional image data is converted into one-dimensional data on the basis of the histogram of the gray level distribution of a gray scale picture, which is obtained with respect to a certain subblock 5. Since, therefore, the positional information of the gray level can not be taken into consideration for the determination of a threshold, it is impossible to determine the threshold accurately. Further, the threshold .theta.(x, y) for each pixel is obtained by the interpolation on the basis of .theta..sub.ij determined as above, and therefore the threshold .theta. (x, y) for a certain pixel can become different from a true value for the certain pixel. Moreover, the data processing as described above necessitates a considerably long processing time. As a result, it becomes impossible to recognize the subject to be extracted on a real time basis.